package com.ws.entity;

import lombok.Data;

/**
 * @author 王硕
 * @version jdk21
 * @className Circle
 * @description
 * @date 2024/11/7 21:54
 */
@Data
public class Circle {
    private double radius;

    public Circle(double radius) {
        this.radius = radius;
    }

    // 求周长
    public double getPerimeter() {
        return 2 * Math.PI * radius;
    }

    // 求面积
    public double getArea() {
        return Math.PI * radius * radius;
    }
}
